<?php
/**
 * Created by Command.
 * User: Vito
 */

declare (strict_types = 1);

namespace app\logic;

use app\model\Surrounding;

class SurroundingLogic extends BaseLogic
{

    /**
     * 设置模型
     * @return string
     */
    protected function getModelName(): string
    {
        return Surrounding::class;
    }

    /**
     * @Description: 获取周边列表
     * @author: xiayu <cb1071403016@126.com>
     * @Date: 2022-11-15 15:16:26
     * @version: 1.0.0
     * @return [type]
     */    
    public static function getSurrounding($params = null){
        $where['status'] = 1;

        $res = Surrounding::where($where)->limit(20)->order('id','desc')->select();

        return $res;
    }

    /**
     * @Description: 获取周边详情
     * @author: xiayu <cb1071403016@126.com>
     * @param [type] $params
     * @Date: 2022-11-15 15:44:38
     * @version: 1.0.0
     * @return [type]
     */    
    public static function getSurroundDetail($params){

        $where['id'] = $params['id'];

        $res = Surrounding::where($where)->find();

        return $res;
    }
}
